package com.rabbit.exception;

import com.rabbit.constant.ResultCodeEnum;
import lombok.Getter;

/**
 * <h1>通用异常类</h1>
 *
 * @author zjw
 * @date 2020/09/06
 */
@Getter
public class BusinessException extends Exception {

    private ResultCodeEnum resultCodeEnum;
    private Integer code;
    private String message;

    public BusinessException() {

    }

    public BusinessException(ResultCodeEnum resultCodeEnum) {
        super();
        this.resultCodeEnum = resultCodeEnum;
    }

    public BusinessException(ResultCodeEnum resultCodeEnum, String message) {
        super();
        this.code = resultCodeEnum.getCode();
        this.message = message;
    }

}
